


eststo clear
set more off
use Data/event_study_sample_quartsince2006.dta, clear

 

 
	

format quarter %tq
label var quarter "Year-Quarter"
label var year "Year"

merge m:1 postcode using Data/bypostcode.dta, keepusing(above_med* NCustomer_pc quintiles_Relative) // created in Desc_stats_roof





** difference in green power by dwelling suitablity 
reg green_plan i.above_medRelative##i.year   [aweight =NCustomer_pc] if year!=2016 & year >=2009, cluster(postcode)


margins year, dydx(above_medRelative)  

est store green_diff
marginsplot,  recastci(rarea) ciopts(color(gs14)) plotopts(color(gs5)   msize(small)) ytitle("Difference in green power (% customers)" , size(large)) title("") ylabel(, labsize(large)) xlabel(, labsize(large)) xtitle("Year", size(large))

graph export Analysis/diff_greensince2009_yearweightroofrelative.png,  replace
graph export Analysis/diff_greensince2009_yearweightroofrelative.eps,  replace









** difference in aggregate solar by dwelling suitablity 
reg cum i.above_medRelative##i.year   [aweight =NCustomer_pc] if year!=2016 & year >=2009, cluster(postcode)

margins year, dydx(above_medRelative) 

est store cum
marginsplot,  recastci(rarea) ciopts(color(gs14)) plotopts(color(gs5)   msize(small)) xtitle("Year" , size(large)) ytitle("Difference in Solar Rooftops (000s)", size(large)) title("") ylabel(, labsize(large)) xlabel(, labsize(large)) xtitle("Year", size(large))

graph export Analysis/diff_cumsince2009_yearweightroofrelative.png, replace



graph export Analysis/diff_cumsince2009_yearweightroofrelative.eps,  replace














